package com.example.listview;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.ImageView;
import android.widget.TextView;

public class detail_Activity extends AppCompatActivity {
    public ImageView movie_img;
    public TextView movie_tv;
    public TextView movie_info;
    public Movie movie = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail_);

        movie_img = findViewById(R.id.item_img);
        movie_tv = findViewById(R.id.item_tv);
        movie_info = findViewById(R.id.item_info);

//        文字超出设置滚动
        movie_info.setMovementMethod(ScrollingMovementMethod.getInstance());
//        Intent intent = getIntent();
        movie=(Movie) getIntent().getSerializableExtra("movie");
        movie_img.setBackgroundResource(movie.getImg());
        movie_tv.setText(movie.getMovie_name());
        movie_info.setText(movie.getInfo());


    }
}
